package com.headFirstModel.factoryPattern.abstractFactory.ny;

import com.headFirstModel.factoryPattern.abstractFactory.Pizza;
import com.headFirstModel.factoryPattern.abstractFactory.PizzaIngredientFactory;
import com.headFirstModel.factoryPattern.abstractFactory.PizzaSotre;

/**
 * 纽约的一家披萨加盟店
 */
public class NYStylePizzaStore extends PizzaSotre {
    @Override
    protected Pizza createPizza(String type) {
        Pizza pizza=null;
        //纽约店用到纽约披萨原料工厂生产纽约分为披萨
        PizzaIngredientFactory ingredientFactory=new NYPizzaIngredientFactory();
       if(type.equals("veggie")){
           pizza=new NYVeggiePizza(ingredientFactory);
       }if(type.equals("peppernoi")){
           pizza=new NYPeppernoiPizza(ingredientFactory);
        }
       return pizza;
    }
}
